package com.boardgame.gwt.service.operate.action.cert;

import java.util.regex.Matcher;

import com.boardgame.common.entity.ResponseInfo;
import com.boardgame.gwt.data.GwtGameBoard;
import com.boardgame.gwt.service.operate.SyntaxBaseAction;
import com.boardgame.gwt.service.operate.SyntaxRequest;

/**
 * 获取证书基础类
 * @author Eric_Zhu
 *
 */
public abstract class GainCertBaseAction extends SyntaxBaseAction {


    @Override
    public ResponseInfo action(GwtGameBoard gwtGameBoard, SyntaxRequest syntaxRequest, Matcher matcher) {
        super.action(gwtGameBoard, syntaxRequest, matcher);
        //增加玩家证书
        gwtGameBoard.getCurrentPlayer().addCert(gainCertStep());
        
        return ResponseInfo.Success(null);
    }
	
	//获取证书的数量
	protected abstract int gainCertStep();
}
